﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FJERP.BLL;


namespace FJERP
{
    public partial class PurchaseOutAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Loadxiala();
                Loadxiala1();
                Loadxiala2();
            }
        }
        public void Loadxiala()
        {
            SupplierBLL bll = new SupplierBLL();
            this.DropDownList1.DataSource = bll.ShowSupplier();//返回的是DataTable，将其绑定到控件,获取数据源
            //显示“请选择”
            ListItem lt = new ListItem();
            this.DropDownList1.DataValueField = "Supplier_Id";//控件绑定值
            this.DropDownList1.DataTextField = "Supplier_Name";//控件显示的字段
            this.DropDownList1.DataBind(); //进行绑定
            lt.Text = "-->请选择级别<--";//绑定的请选择
            lt.Value = "0";//赋值
            lt.Selected = true;
            DropDownList1.Items.Add(lt);


        }
        public void Loadxiala1()
        {
            WareHoseBLL bll = new WareHoseBLL();
            this.DropDownList2.DataSource = bll.ShowWareHose();//返回的是DataTable，将其绑定到控件,获取数据源
            //显示“请选择”
            ListItem lt = new ListItem();
            this.DropDownList2.DataValueField = "WareHose_Id";//控件绑定值
            this.DropDownList2.DataTextField = "WareHose_Name";//控件显示的字段
            this.DropDownList2.DataBind(); //进行绑定
            lt.Text = "-->请选择级别<--";//绑定的请选择
            lt.Value = "0";//赋值
            lt.Selected = true;
            DropDownList2.Items.Add(lt);


        }
        public void Loadxiala2()
        {
            EmployeeBLL bll = new EmployeeBLL();
            this.DropDownList3.DataSource = bll.Empoyee_Show(1);//返回的是DataTable，将其绑定到控件,获取数据源
            //显示“请选择”
            ListItem lt = new ListItem();
            this.DropDownList3.DataValueField = "Employee_Id";//控件绑定值
            this.DropDownList3.DataTextField = "Employee_Name";//控件显示的字段
            this.DropDownList3.DataBind(); //进行绑定
            lt.Text = "-->请选择级别<--";//绑定的请选择
            lt.Value = "0";//赋值
            lt.Selected = true;
            DropDownList3.Items.Add(lt);
        }
    }
}